package com.lnu.information.thread;

/**
 * @author : jian.zhang-2
 * @description:
 * @date : Create in 3:43 PM 2022/5/12
 * @modified By :
 */
public class TrainRunnable implements Runnable{

    Tickets ts = new Tickets();

    @Override
    public void run() {
        while (true){
            if(ts.getNum() > 0){
                ts.saleTicket();
            }else {
                System.out.println(Thread.currentThread() + ":There is no tickets");
            }
        }
    }
}
